package com.wind.trademark.user.dao.impl;


import java.util.Map;

import org.apache.commons.lang.StringUtils;

public class RoleSql {
	public static String queryRoleSQL( Map<String,Object> params){
		
		StringBuffer stringBuffer= new StringBuffer();
		stringBuffer.append("SELECT * FROM ACC_ROLE role WHERE 1=1 ");

		if(StringUtils.isNotEmpty((String)params.get("name"))){
			stringBuffer.append(" AND role.name LIKE :name ");	
			params.put("name", "%"+params.get("name").toString()+"%");

		}
		if(StringUtils.isNotEmpty((String)params.get("enable"))){
			stringBuffer.append(" AND role.enable = :enable ");	

		}
		stringBuffer.append(" ORDER BY role.create_time");
		return stringBuffer.toString();
	}
}
